package com.coffee.order.service.sku.dao;

import com.coffee.order.api.sku.query.SkuOrderQuery;
import com.coffee.order.service.inquire.bean.InquireOrder;
import com.coffee.order.service.sku.bean.SkuOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface SkuOrderDao {
    public SkuOrder findById(@Param("id") Integer id);

    public SkuOrder findByIdAndMerchantId(@Param("id") Integer id, @Param("merchantId") Integer merchantId);

    public SkuOrder findByIdAndSupplierId(@Param("id") Integer id, @Param("supplierId") Integer supplierId);

    public SkuOrder findByIdForUpdate(Integer id);

    public List<SkuOrder> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") SkuOrderQuery param);

    public List<Integer> getSkuOrderId(@Param("param") SkuOrderQuery param);

    public Integer countByWaiting(@Param("param") SkuOrderQuery param);

    public List<SkuOrder> page(@Param("param") SkuOrderQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public List<SkuOrder> listBySku(@Param("param") SkuOrderQuery param);

    public List<SkuOrder> listByPeriodization(@Param("param") SkuOrderQuery param);

    public List<SkuOrder> listByNew(@Param("param") SkuOrderQuery param);

    public List<SkuOrder> pageByWaiting(@Param("param") SkuOrderQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public List<SkuOrder> list(@Param("param") SkuOrderQuery param);

    public List<SkuOrder> getListByOrderId(@Param("status") String status, @Param("id") Integer id);

    public SkuOrder findFirst(@Param("param") SkuOrderQuery param);

    public Integer insert(SkuOrder param);

    Integer insertBatch(List<SkuOrder> list);

    public void updateById(@Param("param") SkuOrder param);

    public void updateByPartSn(@Param("partSn") String partSn);

    public Integer deleteById(Integer id);

    public Integer deleteByIds(List<Integer> idList);

    public void updateByOrderId(@Param("param") SkuOrder param);

    public void updateModifyPriceByOrderId(@Param("param") SkuOrder param);

    public void updateStatusByOrderId(@Param("orderId") Integer order, @Param("status") String status);

    public Double getEnjoyPayPrice(@Param("merchantId") Integer merchantId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getEnjoyPayPriceByMerchantIds(@Param("idList") List<Integer> idList, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    //先享后付(已结清)
    public Double getEnjoyPayPriceBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //先享后付(已结清)邮费
    public Double getEnjoyPayPriceBySuccessByPostage(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //先享后付(已结清)数量
    public Integer getEnjoyCountBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //先享后付(待结清)
    public Double getEnjoyPayPriceByWait(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getEnjoyPayPriceByWaitByPostage(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //先享后付(待结清)数量
    public Integer getEnjoyCountByWait(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //现货现结
    public Double getBuyPayPriceBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getPeriodizationPayPriceBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getBuyPayPriceBySuccessByPostage(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getPeriodizationPayPriceBySuccessByPostage(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //现货现结
    public Integer getBuyCountBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Integer getPeriodizationCountBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Integer getBuyCountBySuccessAndCar(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //退款
    public Double getRefundPriceBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //退款数量
    public Integer getRefundCountBySuccess(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //线下支付(待结清)
    public Double getOfflinePayPrice(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    public Double getOfflinePayPricePostage(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
    //先享后付(待结清)数量
    public Integer getOfflineCount(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}